﻿#region Using directives

using System;

#endregion

namespace InfoExpress.HIV.Domains
{	
	///<summary>
	/// An object representation of the 'BenhNhanDangKy' table. [No description found the database]	
	///</summary>
	/// <remarks>
	/// This file is generated once and will never be overwritten.
	/// </remarks>	
	[Serializable]
	[CLSCompliant(true)]
	public partial class BenhNhanDangKy : BenhNhanDangKyBase
	{		
		#region Constructors

		///<summary>
		/// Creates a new <see cref="BenhNhanDangKy"/> instance.
		///</summary>
		public BenhNhanDangKy():base(){}	
		
		#endregion

    /// <summary>
    /// Wrapper of HinhAnh property, to convert Image to Byte array and vice versa.
    /// </summary>
    public System.Drawing.Image ImgHinhAnh
    {
      get
      {
        if (HinhAnh != null)
        {
          using (System.IO.MemoryStream ms = new System.IO.MemoryStream(HinhAnh))
          {
            System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
            return returnImage;
          }
        }
        else
          return null;
      }
      set
      {
        if (value != null)
        {
          using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
          {
            value.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
            HinhAnh = ms.ToArray();
          }
        }
        else
          HinhAnh = null;
      }
    }
  }
}
